Skip to content

Fix redundant Z-Image terminal timestep#13730

Open
rootonchair wants to merge 2 commits into
huggingface:mainfrom
rootonchair:fix/z-image-redundant-timestep
Open

Fix redundant Z-Image terminal timestep#13730
rootonchair wants to merge 2 commits into
huggingface:mainfrom
rootonchair:fix/z-image-redundant-timestep

Conversation

@rootonchair
Copy link
Copy Markdown
Contributor

@rootonchair rootonchair commented May 12, 2026

What does this PR do?

Summary

This PR fixes a redundant terminal denoising step in Z-Image pipelines.

Previously, Z-Image pipelines mutated the scheduler with scheduler.sigma_min = 0.0.
With FlowMatchEulerDiscreteScheduler, this caused the generated timestep/sigma schedule to include a model-forward step at terminal sigma 0.0, while the scheduler also appended its own terminal 0.0. The final denoising step therefore became a no-op transition from 0.0 -> 0.0.

This change makes Z-Image pipelines compute their default sigma schedule up front and pass it through the existing sigmas argument, instead of mutating scheduler.sigma_min.

Behavior

Old Schedule

Requested steps Scheduler sigmas Effective updates
9 [1.0, 0.875, ..., 0.125, 0.0, 0.0] 8 meaningful + 1 no-op

New Schedule

Requested steps Scheduler sigmas Effective updates
8 [1.0, 0.875, ..., 0.125, 0.0] 8 meaningful

Result Check

Generated 1024x1024 images with Tongyi-MAI/Z-Image-Turbo, prompt dance monkey, seed 0.

New 8 steps

new_8_steps_1024

Old 9 steps

old_9_steps_1024

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@sayakpaul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant